package com.heima.article.controller.v1;

import com.heima.article.service.ApUserBehaviorService;
import com.heima.model.article.dtos.ArticleBehaviorDto;
import com.heima.model.behavior.dtos.CollectionBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1")
public class ApUserBehaviorController {
    @Autowired
    private ApUserBehaviorService apUserBehaviorService;

    /**
     * 用户收藏
     */
    @PostMapping("/collection_behavior")
    public ResponseResult userCollection(@RequestBody CollectionBehaviorDto dto){
        return apUserBehaviorService.userCollection(dto);
    }

    /**
     * 加载用户行为
     */
    @PostMapping("/article/load_article_behavior")
    public ResponseResult loadArticleBehavior(@RequestBody ArticleBehaviorDto dto){
        return apUserBehaviorService.loadArticleBehavior(dto);
    }
}
